#include <iostream>
#include <string>

#include "tcpclient.hpp"

void Usage() { printf("\n\tUsage : ./client ip port[port>1024]\n\n"); }

int main(int argc, char* argv[]) {
  if (argc != 3) {
    Usage();
    exit(-1);
  }

  // 获取用户输入的IP与端口号
  int16_t port = std::stoi(argv[2]);
  std::string ip(argv[1]);

  // 实例化客户端对象
  TcpClient tc(ip, port);
  tc.Init();
  tc.Start();

  return 0;
}